﻿<ResourceDictionary
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
	xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
	 xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" 
    xmlns:GalaSoft_MvvmLight_Command="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Extras.WP71" 
	xmlns:ShoppingList_Converters="clr-namespace:ShoppingList.Converters" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" 
	xmlns:ec="clr-namespace:Microsoft.Expression.Interactivity.Core;assembly=Microsoft.Expression.Interactions"
	>
	<!-- Resource dictionary entries should be defined here. -->
	<ShoppingList_Converters:StringToImageConverter x:Key="StringToImageConverter"/>
	<DataTemplate x:Key="ListItemHubTile">
		<Grid>
			<toolkit:HubTile Margin="3"/>
		</Grid>
	</DataTemplate>
	<ItemsPanelTemplate x:Key="ListBoxHubTilePanel">
		<toolkit:WrapPanel/>
	</ItemsPanelTemplate>
	<DataTemplate x:Key="ListboxDataTemplateHubTile">
		<Grid>
			<toolkit:HubTile Title="{Binding Title}" Margin="3" 
				Notification="{Binding Notification}"
				DisplayNotification="{Binding DisplayNotification}" 
				Message="{Binding Message}" 
				GroupTag="{Binding GroupTag}" Source="{Binding ImageUri}">
				<i:Interaction.Triggers>
					<i:EventTrigger EventName="Tap">
						<GalaSoft_MvvmLight_Command:EventToCommand Command="{Binding TapCommand}" CommandParameter="{Binding Title, Mode=TwoWay}"/>
					</i:EventTrigger>
				</i:Interaction.Triggers>
			</toolkit:HubTile>
		</Grid>
	</DataTemplate>
	<Style x:Key="MetroButtonaStyle" TargetType="Button">
		<Setter Property="Background" Value="Transparent"/>
		<Setter Property="BorderBrush" Value="{StaticResource PhoneForegroundBrush}"/>
		<Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}"/>
		<Setter Property="BorderThickness" Value="{StaticResource PhoneBorderThickness}"/>
		<Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilySemiBold}"/>
		<Setter Property="FontSize" Value="{StaticResource PhoneFontSizeMediumLarge}"/>
		<Setter Property="Padding" Value="10,3,10,5"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="Button">
					<Grid Background="Transparent" Height="100" Width="100">
						<VisualStateManager.VisualStateGroups>
							<VisualStateGroup x:Name="CommonStates">
								<VisualState x:Name="Normal"/>
								<VisualState x:Name="MouseOver"/>
								<VisualState x:Name="Pressed">
									<Storyboard>
										<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentContainer">
											<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneBackgroundBrush}"/>
										</ObjectAnimationUsingKeyFrames>
										<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="ButtonBackground">
											<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneForegroundBrush}"/>
										</ObjectAnimationUsingKeyFrames>
										<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="ButtonBackground">
											<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneForegroundBrush}"/>
										</ObjectAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
								<VisualState x:Name="Disabled">
									<Storyboard>
										<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentContainer">
											<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}"/>
										</ObjectAnimationUsingKeyFrames>
										<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="ButtonBackground">
											<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}"/>
										</ObjectAnimationUsingKeyFrames>
										<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="ButtonBackground">
											<DiscreteObjectKeyFrame KeyTime="0" Value="Transparent"/>
										</ObjectAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
							</VisualStateGroup>
						</VisualStateManager.VisualStateGroups>
						<Border x:Name="ButtonBackground" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{StaticResource PhoneBorderThickness}" Background="{TemplateBinding Background}" CornerRadius="100" Margin="{StaticResource PhoneTouchTargetOverhang}">
							<ContentControl x:Name="ContentContainer" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Foreground="{TemplateBinding Foreground}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" Padding="{TemplateBinding Padding}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
						</Border>
					</Grid>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	<DataTemplate x:Key="FolderButtonStyle">
		<Grid>
			<Image Source="/icons/appbar.folder.rest.png"/>
		</Grid>
	</DataTemplate>
	<DataTemplate x:Key="CameraButtonStyle">
		<Grid>
			<Image Source="/icons/appbar.feature.camera.rest.png"/>
		</Grid>
	</DataTemplate>
	<SolidColorBrush x:Key="ForegroundBrush" Color="White"/>
	<DataTemplate x:Key="TileCameraButton">
		<StackPanel Orientation="Horizontal">
			<Grid Height="48" Width="48">
				<Image Source="/icons/appbar.basecircle.rest.png"/>
				<Image Source="/icons/appbar.add.rest.png"/>
			</Grid>
			<TextBlock TextWrapping="Wrap" Text="Agregar foto" Style="{StaticResource PhoneTextNormalStyle}" VerticalAlignment="Center" Foreground="{StaticResource ForegroundBrush}"/>
		</StackPanel>
	</DataTemplate>
	<DataTemplate x:Key="TileAddButtonTemplate">
		<StackPanel Orientation="Horizontal">
			<Grid Height="48" Width="48">
				<Image Source="/icons/appbar.basecircle.rest.png"/>
				<Image Source="/icons/appbar.add.rest.png"/>
			</Grid>
			<TextBlock TextWrapping="Wrap" Text="Agregar elemento" Style="{StaticResource PhoneTextNormalStyle}" VerticalAlignment="Center" Foreground="{StaticResource ForegroundBrush}"/>
		</StackPanel>
	</DataTemplate>
	<DataTemplate x:Key="MyshoppingListBoxItemTemplate">
		<Grid d:DesignWidth="302" d:DesignHeight="105">
			<toolkit:ContextMenuService.ContextMenu>
													
													<toolkit:ContextMenu x:Name="MyMenu" > 
														<toolkit:MenuItem Header="Actualizar"
														DataContext="{Binding DataContext, ElementName=pivot}"
														Command="{Binding UpdateAccountCommand}"
														CommandParameter="{Binding DataContext, ElementName=MyMenu, Mode=TwoWay}" 
														>
														<i:Interaction.Triggers >
															<i:EventTrigger EventName="Click"  >
																<ec:GoToStateAction StateName="ShowNewAccount"  TargetObject="{Binding ElementName=phoneApplicationPage}"/>
															</i:EventTrigger>
														</i:Interaction.Triggers>
														</toolkit:MenuItem>
														
														<toolkit:MenuItem Header="Eliminar" DataContext="{Binding DataContext, ElementName=pivot}"
														Command="{Binding DeleteAccountCommand, Mode=OneWay}" 
														CommandParameter="{Binding DataContext, ElementName=MyMenu, Mode=TwoWay}" 
														/>              		
														</toolkit:ContextMenu>                 	
												</toolkit:ContextMenuService.ContextMenu>
			<Grid.ColumnDefinitions>
				<ColumnDefinition Width="0.338*"/>
				<ColumnDefinition Width="0.662*"/>
			</Grid.ColumnDefinitions>
			<Image Height="85" Margin="8,8,9,12" Source="{Binding Product.ImageUri, Converter={StaticResource StringToImageConverter}}"/>
			<TextBlock Margin="8" TextWrapping="Wrap" Text="{Binding Product.Name, Mode=TwoWay}" Grid.Column="1" VerticalAlignment="Center" Style="{StaticResource PhoneTextLargeStyle}"/>
		</Grid>
	</DataTemplate>
	<DataTemplate x:Key="ChartListBoxItem">
		<Grid d:DesignWidth="246" d:DesignHeight="38">
			<TextBlock HorizontalAlignment="Left" Margin="0,3,0,8" Style="{StaticResource PhoneTextSmallStyle}" TextWrapping="Wrap" Text="TextBlock" d:LayoutOverrides="Height"/>
			<TextBlock HorizontalAlignment="Right" Margin="0,3,7,8" TextWrapping="Wrap" Text="TextBlock" d:LayoutOverrides="Height"/>
		</Grid>
	</DataTemplate>
</ResourceDictionary>